php forum
php mysql forum
php mysql smarty
 
Topic Options
#262553 - 11/10/03 09:24 PM [question] dynamic style sheets?
vashavoc Offline
Lurker

Registered: 06/17/02
Posts: 9
does ubbt support dymanic style sheet changing?

Top
#262554 - 11/10/03 09:42 PM Re: [question] dynamic style sheets? [Re: ken2]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
What do you mean?<br /><br />User's can select their own stylesheet and change it whenever they want - you also can define stylesheets to sepcific forums. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#262555 - 11/10/03 10:16 PM Re: [question] dynamic style sheets? [Re: Daine]
vashavoc Offline
Lurker

Registered: 06/17/02
Posts: 9
well im making a site and pending if this works as planned, a user can select a color scheme (blue or ornage) and itll change the css as needed on the fly. <br /><br />example: http://www.lestercat.net/dev/CSS_Demo/Alternate_Style_Sheets.html<br /><br />but im curious if ubbt would allow this to function for it as well as the rest of the site. cuz it would look dumb with the rest of the site looking different than the forums imo.

Top
#262556 - 11/10/03 10:20 PM Re: [question] dynamic style sheets? [Re: ken2]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Hmm.. not sure. There would be no need to do that as each user can select their own preferences in their display prefs.<br /><br />But if it's just one stylesheet that acts like that - then it should still behave like that. You'd probably need to test it to be sure.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#262557 - 11/11/03 03:22 AM Re: [question] dynamic style sheets? [Re: Daine]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
As Josh said, users can define their style in the user preferences, but it shouln't be difficult to change with clicking a link. You don't need to do that with javascript, you could simply alter the apropriate user field in the database and reload the page.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#262558 - 11/11/03 09:20 PM Re: [question] dynamic style sheets? [Re: -Fusion-]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
For instantaneous changing, you can pre-load them with javascript... limit in your theme settings to one style then load the others with javascript as alternate styles .css
_________________________
- Allen wavey
- What Drives You?

Top
#262559 - 11/14/03 07:54 AM Re: [question] dynamic style sheets? [Re: SurfMinister]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
This may help to get you started... http://www.alistapart.com/articles/alternate

Top
#262560 - 11/14/03 08:35 AM Re: [question] dynamic style sheets? [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Okay, I have it working somewhat. What I did was download the script from that page and uploaded it to my server. I then added the following code to my header-insert: <br /> <br />
Code:
&lt;script type="text/javascript" <br />src="http://www.drumlines.org/scripts/styleswitcher.js"&gt;&lt;/script&gt; <br /> <br />&lt;link rel="alternate stylesheet" <br />type="text/css" href="http://www.drumlines.org/betathreads/stylesheets/aqua.css" <br />title="aqua" /&gt; <br /> <br />&lt;link rel="alternate stylesheet" <br />type="text/css" href="http://www.drumlines.org/betathreads/stylesheets/mocha.css" <br />title="mocha" /&gt;
<br /> <br />I then went into ubbt_header.tmpl and changed: <br /> <br />
Code:
&lt;link rel="stylesheet" href="$stylesheet" type="text/css" /&gt;
<br /> <br />to this: <br /> <br />
Code:
&lt;link rel="stylesheet" href="$stylesheet" type="text/css" title="default" /&gt;
<br /> <br />I then made a post, in HTML, of this: <br /> <br />
Code:
&lt;a href="#" onclick="setActiveStyleSheet('aqua'); return false;"&gt;Change style to Aqua&lt;/a&gt; <br /> <br />&lt;a href="#" onclick="setActiveStyleSheet('mocha'); return false;"&gt;Change style to Mocha&lt;/a&gt; <br /> <br />&lt;a href="#" onclick="setActiveStyleSheet('default'); return false;"&gt;Change style back to your default.&lt;/a&gt;
<br /> <br />It affects all users, not just you. <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" /> If anyone knows a thing or two about cookies, I'm sure that will solve the problem.

Top
#262561 - 11/14/03 08:37 AM Re: [question] dynamic style sheets? [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
P.S. <br />I wish I could show you an example, but it seems to affect the whole site for everyone, so I have posted it in a private area. JoshPet and Omegatron have access to tinker with it though. <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />P.P.S. <br />If you try this JoshPet and/or Omegatron, it will only work at my /betathreads install.

Top
#262562 - 11/14/03 08:47 AM Re: [question] dynamic style sheets? [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Oh yeah, to answer the initial question, I hypothesise (sp) that this would work site-wide as long as the script and stylesheet headers are in every file and you use identical class tags to UBB throughout your site.

Top
#262563 - 11/14/03 09:02 AM Re: [question] dynamic style sheets? [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
After more hacking, I believe it probably doesn't affect all users, but rather writes the style to your cookie in such a way that the My Cookies clear does not erase it. Probably because it was not written with this in mind. So deleting your cookies will do the trick of returning everything to normal.<br /><br />Again, if anyone out there has any cookie experience, I believe this will be the icing on the cake.

Top
#262564 - 11/14/03 09:09 AM Re: [question] dynamic style sheets? [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
You have to click back to default, then clear your cookies. It acts like it's somehow remembering what was last clicked without using a cookie. [twilight zone music /]

Top
#262565 - 11/14/03 09:39 AM Re: [question] dynamic style sheets? [Re: eslmix]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
From initial looking it does not change every user. <br /> <br />Here are some tidbits from what I found and need work on. <br /> <br />In Internet Explorer one needs the links to click to change stylesheets. <br /> <br />In Mozilla there is a nice little box on the bottom left corner of window that allows you to instantly change themes. <br /> <br />However as expected the change a user makes is only good for one window and when the page refreshes it goes back to the user's default. Basically the javascript allows switching of the stylesheets. What needs to happen is a script to be written upon action of the stylesheet change to rewrite the user's cookie with the updated stylesheet then the change would take place on how many pages the user wanted and changing would simply be clicking the box to change it. Or of course logging out. Rewriting the cookie routine on the fly is more complicated than most things but doable using the present code in threads to another script allowing the stylsheet variable when switching to be passed to the cookie. <br /> <br />Since I assume 6.4 has an updated cookie routine when it goes final it might be something worthwhile to look into as far as hacks are concerned.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#262566 - 11/14/03 09:58 AM Re: [question] dynamic style sheets? [Re: sf49rminer]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Changing pages does make the default style re-appear, but then it changes to what what previously chosen upon completion of the page load.

Top
#262567 - 11/14/03 10:41 AM Re: [question] dynamic style sheets? [Re: eslmix]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Beg to differ <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />The page is loaded back to the default set by the user's cookie which is what is pulled from the database and in the intitial cookie. The problem being this mod allows switching but the user cookie is not updated. <br /> <br />Now the Javascript works in IE and will update the page after loading completes. However there is no nice fancy switcher in IE. One must click those links you provide. <br /> <br />Now in Mozilla you get a nice fancy box which allows switching on the fly. However the page when done does not reload to the alternative stylesheet.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#262568 - 11/18/03 07:01 AM Re: [question] dynamic style sheets? [Re: sf49rminer]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
An update on this...<br /><br />I guess I had loaded too many styles into my header, because my moderators said the site would lock-up their browser. I using about 20 or so styles, so I guess that's pushing it. <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" /> Still a lot of odd behaviour by this though. Anyone else tinkering with this?

Top
#262569 - 11/19/03 01:07 AM Re: [question] dynamic style sheets? [Re: eslmix]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
I plan to do it with a .classic forum, I'll let ya know what problems/fixes I see <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#262570 - 11/19/03 05:58 AM Re: [question] dynamic style sheets? [Re: SurfMinister]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Thanks! <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" />

Top
#262571 - 11/24/03 05:03 AM Re: [question] dynamic style sheets? [Re: eslmix]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
You could avoid these problems by not using javascript but php for switching the css-files. This way, your users can change the style even if they have javascript disabled.
_________________________
Running a community? -> Keep informed and take it to the next level

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks